import { getDefaultFields } from '../utils';

module.exports = app => {
	const DataTypes = app.Sequelize;

	const Model = app.model.define('feedback', {
		id: {
			type: DataTypes.INTEGER(8).UNSIGNED,
			allowNull: false,
			primaryKey: true,
			autoIncrement: true
		},
		user_id: {
			type: DataTypes.STRING(50),
			allowNull: false,
			defaultValue: '0'
		},
		content: {
			type: DataTypes.TEXT,
			allowNull: false
		},
		...getDefaultFields()
	}, {
		tableName: 'feedback',
		timestamps: false
	});


	Model.sync({ alter: true });
	Model.associate = function() {

	}

	return Model;
};
